{  Statement: http://acmp.ru/?main=task&id_task=15
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    i,j,n,ans:longint;
    a:array[0..110,0..110] of longint;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i:=1 to n do
    for j:=1 to n do
        read(a[i][j]);
ans := 0;
for i:=1 to n do
    for j:=1 to n do
        if a[i][j] = 1 then 
            inc(ans);
write(ans div 2);
end.